<extend name="Base/base" />
<block name="main">
        <!-- Content Header (Page header) -->
        <section class="content-header">
			<h1>
				订单信息表
				<small>preview of simple tables</small>
			</h1>
			<ol class="breadcrumb">
				<li><a href="__MODULE__/Index/index"><i class="fa fa-dashboard"></i> 首页</a></li>
				<li><a href="#">订单管理</a></li>
				<li class="active">列表</li>
			</ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-md-12">
              <div class="box">
                <div class="box-header with-border">
                  <h3 class="box-title"><i class="fa fa-th"></i> 订单管理</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
					<div class="form-group">
					<form action="__URL__/index" method="get" class="form-inline">
						<input class="form-control" id="exampleInputName2" placeholder="订单号" type="text" name="onum" size="12">&nbsp;&nbsp;
						<input class="form-control" id="exampleInputName2" placeholder="起始时间" type="text" name="otime1" size="15" value="" readonly onclick="layui.laydate({elem: this, festival: true})"></input> — 
						<input class="form-control" id="exampleInputName2" placeholder="结束时间" type="text" name="otime2" size="15" value="" readonly onclick="layui.laydate({elem: this, festival: true})"></input>
						<input type="submit" value="搜索" class="btn btn-primary">
					</form>
					</div>
					<table class="table table-bordered table-hover">
					<thead>
						<tr>
						  <th style="width:50px">ID</th>
						  <th>用户ID</th>
						  <th>店铺ID</th>
						  <th>配送员ID</th>
						  <th>菜品ID</th>
						  <th>订单号</th>
						  <th>数量</th>
						  <th>下单时间</th>
						  <th>送达时间</th>
						  <th>状态</th>
						  <th>备注</th>
						</tr>
					</thead>
					<tbody>
				<foreach name="list" item="ind">
						<tr>
						  <td>{$ind.id}</td>
						  <td>{$ind.username}</td>
						  <td>{$ind.shopname}</td>
						  <td>{$ind.name}</td>
						  <td>{$ind.menu}</td>
						  <td>{$ind.order_num}</td>
						  <td>{$ind.num}</td>
						  <td>{$ind.start_time|date="Y-m-d H:i:s",###}</td>
						  <td>
							<if condition="$ind.state eq 1">
							<elseif condition="$ind.state eq 2"/>
							<elseif condition="$ind.state eq 3"/>
							<else />{$ind.end_time|date="Y-m-d H:i:s",###}
							</if>
						  </td>
						  <td>
							<if condition="$ind.state eq 1">已下单
						    <elseif condition="$ind.state eq 2"/>已接单
						    <elseif condition="$ind.state eq 3"/>配送中
						    <else /> 配送完成
						    </if>
						  </td>
						  <td>{$ind.remark}</td>
						</tr>
                </foreach>
				</tbody>
                  </table>
				
                </div><!-- /.box-body -->
                <div class="box-footer clearfix">
                  <ul class="pagination pagination-sm no-margin pull-right">
                     {$pageinfo}
                  </ul>
                </div>
              </div><!-- /.box -->

            </div><!-- /.col -->
            
          </div><!-- /.row -->
         
        </section><!-- /.content -->
 </block>
 <block name="myscript">
	<script>
		layui.use('laydate', function(){
		  var laydate = layui.laydate;
		  
		  var start = {
			min: laydate.now()
			,max: '2099-06-16 23:59:59'
			,istoday: false
			,choose: function(datas){
			  end.min = datas; //开始日选好后，重置结束日的最小日期
			  end.start = datas //将结束日的初始值设定为开始日
			}
		  };
		  
		  var end = {
			min: laydate.now()
			,max: '2099-06-16 23:59:59'
			,istoday: false
			,choose: function(datas){
			  start.max = datas; //结束日选好后，重置开始日的最大日期
			}
		  };
		  
		  document.getElementById('LAY_demorange_s').onclick = function(){
			start.elem = this;
			laydate(start);
		  }
		  document.getElementById('LAY_demorange_e').onclick = function(){
			end.elem = this
			laydate(end);
		  }
		  
		});
</script>
 </block>